home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Intercept
/
Visual Intercept.iso
/
sheriff.z
/
isacctfn.bas
next >
Wrap
BASIC Source File
|
1996-08-26
|
6KB
|
175 lines
Attribute VB_Name = "IIAccount"
'----------------------------------------------------------------------------
' isacctfn.bas is a member of the Visual Intercept Visual Basic API.
' Copyright (c) 1996 Elsinore Technologies, Inc. All rights reserved.
'
' This software is protected by copyright law. Unauthorized reproduction
' or distribution of this program, or any portion of it, may result in
' severe civil or criminal penalties. If you have any questions about
' your redistribution rights, please contact Elsinore Technologies, Inc.
'
' Creator: Albert J. Lin (AJL)
' History: Created 09/17/95
'----------------------------------------------------------------------------
'----------------------------------------------------------------------------
' Visual Intercept Account Declaration:
'----------------------------------------------------------------------------
Public Type VIAccount
code As String
name As String
userID As String
description As String
rate As Double
End Type
Public Type IEAccount
lpCode As String
lpName As String
lpUserID As String
lpDescription As String
rate As Double
lnCode As Integer
lnName As Integer
lnUserID As Integer
lnDescription As Integer
End Type
'/* Account API. */
Public Declare Function IIInsertAccount Lib "isapi.dll" (pAccount As IEAccount) As Long
Public Declare Function IIDeleteAccount Lib "isapi.dll" (pAccount As IEAccount, ByVal clause As String) As Long
Public Declare Function IIModifyAccount Lib "isapi.dll" (pAccount As IEAccount, ByVal clause As String) As Long
Public Declare Function IIFetchAccount Lib "isapi.dll" (pAccount As IEAccount, ByVal clause As String) As Long
Public Declare Function IIFetchAccounts Lib "isapi.dll" (ByRef pnTotal As Long, ByVal clause As String) As Long
Public Declare Function IIGetAccount Lib "isapi.dll" (pAccount As IEAccount, ByVal nIndex As Long) As Long
Public Function VBIIInitAccount(account As IEAccount)
account.lnCode = lnIIAccountCode
account.lnName = lnIIAccountName
account.lnUserID = lnIIUserID
account.lnDescription = lnIIDescription
account.lpCode = String(account.lnCode, 0)
account.lpName = String(account.lnName, 0)
account.lpUserID = String(account.lnUserID, 0)
account.lpDescription = String(account.lnDescription, 0)
account.rate = 0
End Function
Public Function VBIIConvertAccount(account As IEAccount, userAccount As VIAccount)
userAccount.code = account.lpCode
userAccount.name = account.lpName
userAccount.userID = account.lpUserID
userAccount.description = account.lpDescription
userAccount.rate = account.rate
End Function
Public Function VBIIInsertAccount(userAccount As VIAccount) As Long
Dim account As IEAccount
Dim err As Long
Call VBIIInitAccount(account)
Call VBIIPrepareAccount(account, userAccount)
err = IIInsertAccount(account)
VBIIInsertAccount = err
End Function
Public Function VBIIDeleteAccount(userAccount As VIAccount, ByRef clause As String) As Long
Dim account As IEAccount
Dim err As Long
Call VBIIInitAccount(account)
Call VBIIPrepareAccount(account, userAccount)
rError = IIDeleteAccount(account, clause)
VBIIDeleteAccount = err
End Function
Public Function VBIIFetchAccount(userAccount As VIAccount, ByRef clause As String) As Long
Dim account As IEAccount
Dim err As Long
Call VBIIInitAccount(account)
Call VBIIPrepareAccount(account, userAccount)
err = IIFetchAccount(account, clause)
If err = 0 Then
Call VBIIConvertAccount(account, userAccount)
End If
VBIIFetchAccount = err
End Function
Public Function VBIIModifyAccount(userAccount As VIAccount, ByRef clause As String) As Long
Dim account As IEAccount
Dim err As Long
Call VBIIInitAccount(account)
Call VBIIPrepareAccount(account, userAccount)
err = IIModifyAccount(account, clause)
VBIIModifyAccount = err
End Function
Public Function VBIIPrepareAccount(account As IEAccount, userAccount As VIAccount)
account.lpCode = userAccount.code
account.lpName = userAccount.name
account.lpUserID = userAccount.userID
account.lpDescription = userAccount.description
account.rate = userAccount.rate
account.lnCode = Len(userAccount.code)
account.lnName = Len(userAccount.name)
account.lnUserID = Len(userAccount.userID)
account.lnDescription = Len(userAccount.description)
End Function
Public Function VBIIFetchAccounts(ByRef rnTotal As Long, ByRef clause As String) As Long
Dim err As Long
err = IIFetchAccounts(rnTotal, clause)
VBIIFetchAccounts = err
End Function
Public Function VBIIGetAccount(userAccount As VIAccount, ByVal nIndex As Long) As Long
Dim account As IEAccount
Dim err As Long
Call VBIIInitAccount(account)
err = IIGetAccount(account, nIndex)
If err = 0 Then
Call VBIIConvertAccount(account, userAccount)
End If
VBIIGetAccount = err
End Function